package T2;

public class test2 {
        public static void main(String[] args) {
            Point p1 = new Point(3, 4);
            Point p2 = new Point(5, 6);
            System.out.println("p1与p2两点之间的距离为: " +
                    String.format("%.2f", p1.distance(p2)));
//            使用String.format让输出变成保留两位小数的字符串

            Circle c1 = new Circle(p1, 5);
            Circle c2 = new Circle(p2, 3);

            System.out.println("c1的周长为: " + String.format("%.2f", c1.perimeter()));
            System.out.println("c1的面积为: " + String.format("%.2f", c1.area()));

            int relation = c1.relation(c2);
            switch (relation) {
                case 0:
                    System.out.println("同一圆");
                    break;
                case 1:
                    System.out.println("同心圆");
                    break;
                case 2:
                    System.out.println("相交的圆");
                    break;
                case 3:
                    System.out.println("分离的圆");
                    break;
                case 4:
                    System.out.println("包含的圆");
                    break;
            }
        }
}
